package com.yiqi.liebang.feature.mine.model;

import android.text.TextUtils;

import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.yiqi.liebang.entity.bo.AddTopicBo;
import com.yiqi.liebang.entity.bo.UserCardBo;
import com.yiqi.liebang.entity.bo.UserParamBo;
import com.yiqi.liebang.feature.mine.contract.CertificationContract;
import com.yiqi.liebang.feature.mine.contract.TopicContract;
import com.yiqi.liebang.feature.mine.dependencies.certification.DaggerCertificationModelComponent;
import com.yiqi.liebang.feature.mine.dependencies.topic.DaggerTopicModelComponent;
import com.yiqi.liebang.framework.api.ApiLib;
import com.yiqi.liebang.framework.api.UserApi;

import java.io.File;

import javax.inject.Inject;

import io.reactivex.Observable;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;

public class TopicModel implements TopicContract.Model {

    @Inject
    UserApi api;


    @Inject
    public TopicModel() {
        DaggerTopicModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }


    @Override
    public Observable<String> userAddTopic(AddTopicBo addTopicBo) {
        return api.addTopic(addTopicBo).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }

    @Override
    public Observable<String> userEditTopic(AddTopicBo addTopicBo) {
        return api.editTopic(addTopicBo).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }
}
